<?php

/**
 * SfGuardUserProfile form base class.
 *
 * @package    virtualdelivery
 * @subpackage form
 * @author     Your name here
 */
class BaseSfGuardUserProfileForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'usr_id'              => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => true)),
      'usr_type'            => new sfWidgetFormInput(),
      'usr_surname'         => new sfWidgetFormInput(),
      'usr_name'            => new sfWidgetFormInput(),
      'usr_phone'           => new sfWidgetFormInput(),
      'usr_alternate_phone' => new sfWidgetFormInput(),
      'usr_movil'           => new sfWidgetFormInput(),
      'usr_ids_id'          => new sfWidgetFormPropelChoice(array('model' => 'PersonalIds', 'add_empty' => false)),
      'usr_ids_nro'         => new sfWidgetFormInput(),
      'usr_sta_id'          => new sfWidgetFormPropelChoice(array('model' => 'GeoStates', 'add_empty' => false)),
      'usr_cty_id'          => new sfWidgetFormPropelChoice(array('model' => 'GeoCities', 'add_empty' => false)),
      'usr_address'         => new sfWidgetFormInput(),
      'usr_address_nro'     => new sfWidgetFormInput(),
      'usr_address_floor'   => new sfWidgetFormInput(),
      'usr_address_dpt'     => new sfWidgetFormInput(),
      'usr_email'           => new sfWidgetFormInput(),
      'usr_birthday_date'   => new sfWidgetFormDateTime(),
      'usr_corporate_cuit'  => new sfWidgetFormInput(),
      'usr_corporate_name'  => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorPropelChoice(array('model' => 'SfGuardUserProfile', 'column' => 'id', 'required' => false)),
      'usr_id'              => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id', 'required' => false)),
      'usr_type'            => new sfValidatorString(array('required' => false)),
      'usr_surname'         => new sfValidatorString(array('max_length' => 50)),
      'usr_name'            => new sfValidatorString(array('max_length' => 50)),
      'usr_phone'           => new sfValidatorString(array('max_length' => 16)),
      'usr_alternate_phone' => new sfValidatorString(array('max_length' => 16, 'required' => false)),
      'usr_movil'           => new sfValidatorString(array('max_length' => 16, 'required' => false)),
      'usr_ids_id'          => new sfValidatorPropelChoice(array('model' => 'PersonalIds', 'column' => 'ids_id')),
      'usr_ids_nro'         => new sfValidatorInteger(),
      'usr_sta_id'          => new sfValidatorPropelChoice(array('model' => 'GeoStates', 'column' => 'sta_id')),
      'usr_cty_id'          => new sfValidatorPropelChoice(array('model' => 'GeoCities', 'column' => 'cty_id')),
      'usr_address'         => new sfValidatorString(array('max_length' => 50)),
      'usr_address_nro'     => new sfValidatorString(array('max_length' => 10)),
      'usr_address_floor'   => new sfValidatorInteger(array('required' => false)),
      'usr_address_dpt'     => new sfValidatorString(array('max_length' => 2, 'required' => false)),
      'usr_email'           => new sfValidatorString(array('max_length' => 40)),
      'usr_birthday_date'   => new sfValidatorDateTime(),
      'usr_corporate_cuit'  => new sfValidatorString(array('max_length' => 17, 'required' => false)),
      'usr_corporate_name'  => new sfValidatorString(array('max_length' => 80, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('sf_guard_user_profile[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'SfGuardUserProfile';
  }


}
